package com.lagou.work2;

import java.io.File;

public class DirectTest {

    public static void main(String[] args) {
        del(new File("/Users/dingxiaowei/Downloads/1111"));
        new File("/Users/dingxiaowei/Downloads/1111").delete();
    }

    public static void del(File file){
        File[] files = file.listFiles();
        for (File file1 : files) {
            if (file1.isFile()){
                file1.delete();
            }
            if (file1.isDirectory()){
                del(file1);
                file1.delete();
            }
        }
    }

}
